home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / os2 / jwsos2.zip / JWS.CMD < prev    next >
OS/2 REXX Batch file  |  1997-03-04  |  6KB  |  138 lines

  1. /* Java WorkShop startup script                                           */
  2. /* This file was created by Cristiano Guadagnino (herbie@mbox.vol.it)     */
  3. /* Latest release of this file: 13/02/1997                                */
  4. /*                                                                        */
  5. /* Release notes:                                                         */
  6. /* This script assumes that JAVA_HOME environment variable is already set */
  7. /* and that it is run from \$JWS_HOME$\OS2\BIN, where $JWS_HOME$ is your  */
  8. /* Java WorkShop home directory. Note that jws.ut.platform is hardcoded.  */
  9. /*                                                                        */
  10. /* The original Copyright statement is below:                             */
  11.  
  12.  
  13. /*                                                                        */
  14. /* @(#)jws       1.75 96/07/30                                            */
  15. /*                                                                        */
  16. /* Copyright (c) 1994 Sun Microsystems, Inc. All Rights Reserved.         */
  17. /*                                                                        */
  18. /* Permission to use, copy, modify, and distribute this software          */
  19. /* and its documentation for NON-COMMERCIAL purposes and without          */
  20. /* fee is hereby granted provided that this copyright notice              */
  21. /* appears in all copies. Please refer to the file "copyright.html"       */
  22. /* for further important copyright and licensing information.             */
  23. /*                                                                        */
  24. /* SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF    */
  25. /* THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED     */
  26. /* TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A            */
  27. /* PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR   */
  28. /* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR    */
  29. /* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.                         */
  30. /*                                                                        */
  31.  
  32. /*                    */
  33. /* Determine JWS_HOME */
  34. /*                    */
  35.  
  36. if VALUE('_SS_JWS_HOME',,'OS2ENVIRONMENT') = "" then do
  37.     curdir = directory()
  38.     homedir = directory("..\..")
  39.     SS_JWS_HOME = homedir
  40.     call directory curdir
  41. end
  42.  
  43. /*                    */
  44. /* Determine JDK_HOME */
  45. /*                    */
  46.  
  47. if VALUE('JAVA_HOME',,'OS2ENVIRONMENT') = "" then do
  48.     say
  49.     say "JAVA_HOME environment variable is not set"
  50.     say "Please set JAVA_HOME to point to your JDK directory"
  51.     say "   (e.g. SET JAVA_HOME=C:\JavaOS2)"
  52.     say
  53.     exit
  54.     end
  55. else do
  56.     SS_JDK_HOME = VALUE('JAVA_HOME',,'OS2ENVIRONMENT')
  57.     CALL VALUE '_SS_JDK_HOME', SS_JDK_HOME, 'OS2ENVIRONMENT'
  58. end
  59.  
  60. ARCH = 'OS2'
  61.  
  62. /*            */
  63. /* Set paths  */
  64. /*            */
  65.  
  66. RUNCLASSPATH = SS_JWS_HOME'\classes;'SS_JWS_HOME'\lib\jws.zip;'SS_JDK_HOME'\lib\classes.zip'
  67. CLASSPATH = SS_JDK_HOME'\lib\classes.zip'
  68. CALL VALUE 'CLASSPATH', CLASSPATH, 'OS2ENVIRONMENT'
  69.  
  70. newpath = VALUE('PATH',,'OS2ENVIRONMENT')||';'SS_JWS_HOME'\OS2\BIN'
  71. CALL VALUE 'PATH', newpath, 'OS2ENVIRONMENT'
  72.  
  73. JWS_BIN=SS_JWS_HOME'\OS2\BIN'
  74.  
  75. CALL VALUE 'LD_LIBRARY_PATH', JWS_BIN, 'OS2ENVIRONMENT'
  76.  
  77. /*                        */
  78. /* Create .jws directory  */
  79. /*                        */
  80.  
  81. dummy = VALUE('HOME', , 'OS2ENVIRONMENT')||'\.jws'
  82. /* say 'Creating 'dummy' directory' */
  83. if directory(dummy)="" then
  84.     'md 'dummy
  85. else
  86.     CALL directory curdir
  87.  
  88. prog = 'javapm'
  89. main_class = 'sun.jws.Main'
  90. opts = ''
  91.  
  92. /*                                                                     */
  93. /* Parse arguments                                                     */
  94. /* the -debug option is assumed to have a value associated with it.    */
  95. /* transform '-debug <file>' to '-debug -Djws.startup.props=<file>'    */
  96.  
  97. args=""
  98. debug_prop=""
  99.  
  100. numopts = ARG()
  101. i = 1
  102. do while i <= numopts
  103.     argn = ARG(i, 'N')
  104.     select
  105.         when argn = '-debug' then do
  106.             prog = 'javapm_g'
  107.             main_class = 'sun.jws.Debugger.Agent'
  108.             debug_prop = '-Ddebug.browser=yes'
  109.             opts = opts||'-noasyncgc'
  110.             end
  111.         when argn = '-classpath' then
  112.             RUNCLASSPATH = ARG(i+1, 'N')||';'||RUNCLASSPATH
  113.         when LEFT(argn, 1) = '-' then
  114.             opts = opts||argn
  115.         otherwise
  116.             args = args||argn
  117.     end
  118.     i = i + 1
  119. end
  120.  
  121. java = SS_JDK_HOME'\bin\'prog
  122.  
  123. /*                      */
  124. /* Add WWW_HOME option  */
  125. /*                      */
  126.  
  127. if VALUE('WWW_HOME', , 'OS2ENVIRONMENT') \= "" then
  128.     opts = opts||'-Dwww.home='VALUE('WWW_HOME', , 'OS2ENVIRONMENT')
  129.  
  130. JWSLOG=dummy'\weblog'
  131. CALL VALUE 'JWSLOG', JWSLOG, 'OS2ENVIRONMENT'
  132.  
  133. if prog = 'javapm_g' then
  134.     java' -classpath 'RUNCLASSPATH' -Djws.home='SS_JWS_HOME' -Dhotjava.home='SS_JWS_HOME' -Djws.bin='JWS_BIN' -Djdk.bin='SS_JDK_HOME'\bin -Djws.ut.user='VALUE('USER' , , 'OS2ENVIRONMENT')' -Djws.ut.platform="OS/2 4.0 i386" -Djws.build.classes='VALUE('CLASSPATH', , 'OS2ENVIRONMENT')' 'debug_prop' 'opts' 'main_class' 'args
  135. else
  136.     java' -classpath 'RUNCLASSPATH' -Djws.home='SS_JWS_HOME' -Dhotjava.home='SS_JWS_HOME' -Djws.bin='JWS_BIN' -Djdk.bin='SS_JDK_HOME'\bin -Djws.ut.user='VALUE('USER' , , 'OS2ENVIRONMENT')' -Djws.ut.platform="OS/2 4.0 i386" -Djws.build.classes='VALUE('CLASSPATH', , 'OS2ENVIRONMENT')' 'debug_prop' 'opts' 'main_class' 'args' >& \dev\nul'
  137.  
  138.